<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#import "/layout/select.ftl" as my/>
<#assign css>
<#--此ftl中用到的css-->
</#assign>
<#assign js>
<#--此ftl中用到的js-->
<script>
	$(".btn-submit").click(function () {
		// 校验表单合法
		var bootstrapValidator = $(".form-edit").data('bootstrapValidator');
		bootstrapValidator.validate();
		if(bootstrapValidator.isValid()){
			$.ajax({
				type: "POST",
				url: "/feedback/edit",
				data: $(".form-edit").serialize(),
				dataType: "JSON",
				success: function(res){
					layer.msg(res.message, {time: 2000
					}, function(){
						location.href="/feedback/index";
					});
				}
			});
		}else{
			return false;
		}
	});

	$('.form-edit').bootstrapValidator({
		message: '请输入有效值',
		feedbackIcons: {
			valid: 'glyphicon glyphicon-ok',
			invalid: 'glyphicon glyphicon-remove',
			validating: 'glyphicon glyphicon-refresh'
		}
	});

</script>
</#assign>
<@layout title="编辑" active="feedback">
<!-- Content Header (Page header) -->
<section class="content-header">
	<h1>
		<#if isAdd>
            新增
        <#else>
            编辑
        </#if>
		<small>订单投诉详细信息</small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="/"><i class="fa fa-home"></i> 管理后台</a></li>
		<li><a href="#"><i class="fa fa-list-ul"></i> 订单投诉管理</a></li>
		<li class="active"><i class="fa fa-edit"></i>
		    <#if isAdd>
                新增
            <#else>
                编辑
            </#if>
		</li>
	</ol>
</section>
<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<!-- Default box -->
			<div class="box  box-primary">
				<form class="form-horizontal form-edit" method="post" action="feedback/edit">
					<div class="box-body">
						<input type="hidden" id="id" name="id" value="${feedback.id!}">
						<input type="hidden" id="isAdd" name="isAdd" value="${isAdd?string('true','false')}">
						<div class="form-group">
							<label class="col-sm-2 control-label">投诉流水号：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入投诉流水号" readonly="true" id="seqNo" name="seqNo" class="form-control" type="text" value="${feedback.seqNo!}" >
							</div>
						</div>
						<#--<div class="form-group">
							<label class="col-sm-2 control-label">投诉类型：</label>
							<div class="col-sm-10">
							    <@my.select id="type" datas=getDict('FEEDBACK_TYPE')  value="${feedback.type!}" defaultValue="请选择"/>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">投诉子类型：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入子类型" id="subType" readonly="true" name="subType" class="form-control" type="text" value="${feedback.subType!}" >
							</div>
						</div>
						--><div class="form-group">
							<label class="col-sm-2 control-label">联系人：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入联系人" id="contact" readonly="true" name="contact" class="form-control" type="text" value="${feedback.contact!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">联系方式：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入联系方式" id="contactWay" readonly="true" name="contactWay" class="form-control" type="text" value="${feedback.contactWay!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">内容：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入内容" id="content" name="content" readonly="true" class="form-control" type="text" value="${feedback.content!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">投诉对应订单ID：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入投诉对应订单编号" id="orderId" readonly="true" name="orderId" class="form-control" type="text" value="${feedback.orderId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">图片：</label>
							<div class="col-sm-10">
								<#--<input required placeholder="请输入图片" id="imgs" name="imgs" class="form-control" type="text" value="${feedback.imgs!}" >-->
								<#list images as item>
									<img src="${item}" style="width:200px;"/>
								</#list>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">投诉用户ID：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入投诉用户id" readonly="true" id="userId" name="userId" class="form-control" type="text" value="${feedback.userId!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">状态：</label>
							<div class="col-sm-10">
								${convert('FEEDBACK_STATE',feedback.state)!}
							    <#--<@my.select id="state" datas=getDict('FEEDBACK_STATE')   value="${feedback.state!}" defaultValue="请选择"/>-->
							</div>
						</div>
						<#--<div class="form-group">
							<label class="col-sm-2 control-label">受理人：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入受理人" id="acceptUserId" name="acceptUserId" class="form-control" type="text" value="${feedback.acceptUserId!}" >
							</div>
						</div>-->
						<#--<div class="form-group">
							<label class="col-sm-2 control-label">受理时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入受理时间" id="acceptTime" name="acceptTime" class="form-control" type="text" value="${feedback.acceptTime!}" >
							</div>
						</div>-->
						<div class="form-group">
							<label class="col-sm-2 control-label">处理结果：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入处理结果" id="result" name="result" class="form-control" type="text" value="${feedback.result!}" >
							</div>
						</div>
						<#--<div class="form-group">
							<label class="col-sm-2 control-label">处理时间：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入处理时间" id="resultTime" name="resultTime" class="form-control" type="text" value="${feedback.resultTime!}" >
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">处理人：</label>
							<div class="col-sm-10">
								<input required placeholder="请输入处理人" id="resultUserId" name="resultUserId" class="form-control" type="text" value="${feedback.resultUserId!}" >
							</div>
						</div>-->

					<div class="box-footer">
						<button type="button" class="btn btn-default btn-back">返回</button>
						<button type="button" class="btn btn-info pull-right btn-submit">提交</button>
					</div>

				</form>
			</div>
			<!-- /.box -->
		</div>
	</div>
</section>
<!-- /.content -->
</@layout>
